package day15;

import day06.Dog;

import java.io.*;

/**
 * Created by kunsb on 2016/11/2.
 */
public class ObjectSave {
    // new Dog()  -- > disk   internet
    //ObjectOutputStream
    public static void main(String[] args) throws Exception {
//        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("C:\\Users\\kunsb\\Desktop\\xxx\\objs\\dog.obj"));
//        Dog dog = new Dog();
//        dog.setName("王厚鑫");
//        dog.setType("girl");
//        dog.setColor("yellow");
//        oos.writeObject(dog);
//        oos.close();
        ObjectInputStream bbs = new ObjectInputStream(new FileInputStream("C:\\Users\\kunsb\\Desktop\\xxx\\objs\\dog.obj"));
        Object object = bbs.readObject();
        Dog whx = (Dog) object;
        System.out.println(whx.getName());
        System.out.println(whx.getType());
        System.out.println(whx.getColor());
    }
}
